<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Market Approvals</title>
<LINK REL="stylesheet" HREF="CSS/Main.css" TYPE="text/css">
<LINK REL="stylesheet" HREF="CSS/Button.css" TYPE="text/css">
</head>
<body>

	<div id="top">
	<h1>Master Data Management</h1>
	<br>
			<a id="log" href="logout">Logout</a><br>
    		<%-- <%@ include file="redirection.jsp" %> --%>
	</div>

<h2 align="center"><b>Market Approvals</b> </h2>
<div align="center">
<form action="MarketApprovalServlet" method="get">

<input type="submit" class="button" name="submit" value="Display Pending Approvals" >

</form >

<% String[][] result=(String[][])request.getAttribute("result");

	if (result != null) {%>
	
		<form action="MarketApprovalServlet" method="post">
		<table border="1" width="1000">
					<tr>
						<td colspan="9">Market Info</td>
					</tr>
					<tr>
						<th>Market Id</th>
						<th>Market Name</th>
						<th>Location</th>
						<th>Commodity Type</th>
						<th>Currency</th>
						<th>Start Date</th>
						<th>End Date</th>
						<th>Status</th>
					</tr> 
	<%	int i=1;
	
	
	for (String[] s : result) {
			%>
			
			<tr >	
			<td><%=s[0]%></td>
			<td><%=s[1]%></td>
			<td><%=s[2]%></td>
			<td><%=s[3]%></td>
			<td><%=s[4]%></td> 
			<td><%=s[5]%></td>
			<td><%=s[6]%></td> 
			
			<td><input type="radio" name="<%=s[0]%>" value="A">Approve</type><br>
			<input type="radio" name="<%=s[0]%>" value="R">Reject</type>
			
 			
 		
 		<%-- 	<%=request.getParameter("status1")%>  s[6][i] = request.getParameter("status1").value; request.setAttribute("status",status%><%=i %> <%); %> --%>
			</td>
			 
			</tr>	
			<%}%>
		</table><br><br>
		<input type="submit" class="button" name="Submitapprove" value="Update Approval Status">
</form>
	<% }%>
<br><br>
	<form action = "MainApproval.jsp">
	<input type="submit" class="button" name="approve" value="Pending Approvals">
</form>
</div>
</body>
</html>